<?php $this->load->view(TEMPLATE_NAME.'/front/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>

<div class="page noright adminpage adminuser">
    <h2>Members</h2>
<p class="f15 purple">Contact a Member</p>
<hr />
	<?php 
	if(!empty($success)){
		echo $success. "<hr />";
	}?>
    <p class="f14 dark">Send a secure message to another user without giving away your name or any personal contact details. An e-mail will be sent to the users 
    registered e-mail address with your message only. They can reply to you in the same way.</p>
    <hr />
    <?php echo form_open('member_contact/'.$username, array('method' => 'post', 'class' => 'formstep formp2','id'=>'member_contact_form'));?>
       
    <? if((!empty($user_tiab['avatar'])) && (file_exists("./uploads/profile/crop/".$user_tiab['avatar']))){
    echo img(array('src' => base_url().'uploads/profile/crop/'.$user_tiab['avatar'], 'width' => '52', 'style' => 'display:block;margin-left:150px;'));
  	} else {?> 
    <img height="52" width="52" src="<?php echo base_url(); ?>xhtml/img/badut.gif"/>
	<?}?>
    <br />
    <label>Username: <strong class="purple">*</strong></label>     
	<p class="mle purple f17">"<?php echo $user_tiab['username'];?>"</p>
	<p class="mle f15"><?php 
	if(!empty($user_info['sex'])){
		if($user_info['sex'] == 'M'){
			echo "Male";
		}else{
			echo "Female";	
		}
	}else{
		echo "Gender not indicated";
	} ?> - <?php 
	if(!empty($user_info['birthdate'])){
		echo GetAge($user_info['birthdate']);	
	}else{
		echo "Age not indicated";
	}
	?></p>
	<hr />
    <label>Networks: <strong class="purple">*</strong></label>
    <span class="purple" style="display:block;margin-left:150px;">    
    <?php if(!empty($network_data)){ 
    foreach($network_data as $network){?>
        <a href="<?php echo site_url('network/'.$network['slug_name'])?>"><?php echo $network['name']?></a><br />
    <?php } 
    }else{ ?>
    	< no networks > 
    <?php }?>    
    </span>    
    <hr />       
    <label>Message: <strong class="purple">*</strong></label>
    <?php if(($settings['contact_preferences'] == 'none') || (($settings['contact_preferences'] == 'member') && (!empty($same_network))) ) {?>
    <p class="purple"><strong>This user is not accepting any e-mails at this time</strong></p> 
    <?php }else{     
    echo form_textarea(array('id'=>'message', 'name'=>'message', 'class'=>'w350'),$network_description);
    } ?>   
    <hr />
    <p class="sp"><label class="purple">Privacy:</label>
    <?php 
    if(!empty($block)){
    	$checked = TRUE;	
    }else{
    	$checked = FALSE;
    }
    echo form_checkbox('block', 'true', $checked);?>Prevent this member from being able to contact you</p> <hr />
    <?php 
        $form_button = array(
          'type'=>'submit',
          'name'=>'submit',
          'value'=>'submit',
          'content'=>'Submit',
        );
        echo form_button($form_button) ?>    
    <?php echo form_close(); ?><!-- formstep -->
    <br />

<?php $this->load->view(TEMPLATE_NAME.'/front/footer_menu');?>
</div><!-- page -->

<?php $this->load->view(TEMPLATE_NAME.'/front/side_right');?>
<div class="clear"></div> 
<?php $this->load->view(TEMPLATE_NAME.'/front/footer');?>

